Troubleshooting

For troubleshooting and lower level nitty gritty details, the command line, configuration files and debuggers are your friends.

OpenCPN has a minimal command line interface (CLI)

Usage: opencpn [-unit_test_1] [-p] [-no_opengl]\\
-unit_test_1
-p
-no_opengl
-fullscreen
[-unit_test_1]

This command test cycles through all possible charts in the currently loaded chart database, adjusting the viewport to show the loaded chart automatically. The value of this test is clear: it provide an unattended stress test of OpenCPN, It is most fun to watch in quilt mode…

The test runs until all charts in the database have been visited once. Lets think of this as a Beta test tool.

A side-effect of this switch is that it can be used to process a set of ENC charts into SENC files. The first, time consuming processing of ENC charts, can this way be done unattended.

[ -p ]

The portable option is explained Portable OpenCPN

[-no_opengl]

A total switch-off of OpenGL, in a more thorough way than in “Options”.

[ -fullscreen ]

Starts OpenCPN in FullScreen mode

Debugging Output Settings for Logfile

The config or ini file contains a lot of settings that are saved between sessions.
Debug statements can be added to produce a lot of output when problems arises in certain areas.
The following statement are recognized and can be added to the config file before a session starts.

[Settings] ...
DebugOpenGL=1   Add logfile debug output for openGL.\\
DebugNMEA=500   Writes 500 NMEA sentences to the log file\\
DebugCM93=1     Writes volumes of debug info relating to CM93 to the logfile.\\
DebugGPSD=1     This will produce some more log output regarding gpsd.\\
DebugS57        Add logfile debug output for S57\\
DebugBSBImg     Add logfile debug output for BSBImg\\
DebugGDAL       Add logfile debug output for GDAL\\

Using a FIFO for ais debugging.

See the code in ais.cpp

/*
   A special test for a user defined FIFO
   To use this method, do the following:
   a.  Create a fifo            $mkfifo /tmp/aisfifo
   b.  netcat into the fifo     $nc {ip} {port}> /tmp/aisfifo
                   sample {ip} {port} could be  nc 82.182.117.51 6401> /tmp/aisfifo
   c.  hand edit opencpn.conf and make AIS data source like this:
        [Settings/AISPort]
        Port=Serial:/tmp/aisfifo

  This also works if you have an ascii ais log
  for which you can simply $cat ais.log> /tmp/aisfifo
  */
  if(m_pPortName->Contains(_T("fifo")))
        goto port_ready;

You may see that if the port name contains the string “fifo”, then the requirement for the port to be a TTY is relaxed.